﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Payroll.BusinessLogic.Caching;
using Payroll.BusinessLogic.Configuration.Settings;
using Payroll.BusinessLogic.Utils;
using Payroll.Common.Utils;
using Payroll.BusinessLogic.Infrastructure;
using PayrollHR.Web;

namespace PayrollHR
{
    public partial class main : BasePayrollAdministrationMasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindData();
            }
        }

        protected void BindData()
        {
            string headerText = string.Format("CRM {0}", this.SettingManager.CurrentVersion);
            lblHeader.Text = headerText;
        }

        protected void lbClearCache_Click(object sender, EventArgs e)
        {
            new PayrollStaticCache().Clear();
        }

        public override void ShowMessage(string message)
        {
            pnlMessage.Visible = true;
            pnlMessage.CssClass = "messageBox messageBoxSuccess";
            lMessage.Text = message;
        }

        public override void ShowError(string message, string completeMessage)
        {
            pnlMessage.Visible = true;
            pnlMessage.CssClass = "messageBox messageBoxError";
            lMessage.Text = message;
            lMessageComplete.Text = completeMessage;
        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Administration/ChangePass.aspx");
        }

    }
}